﻿@model IEnumerable<EasyBlog.Models.InfoBlog>

@{
    ViewData["Title"] = "Index";
}

<h1>首页</h1>

<p>
    <a asp-action="Create">新增</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.UserName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Content)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.VisitCount)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DTCreate)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.UserName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Content)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.VisitCount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DTCreate)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.ID">编辑</a> |
                <a asp-action="Details" asp-route-id="@item.ID">详情</a> |
                <a asp-action="Delete" asp-route-id="@item.ID">删除</a>
            </td>
        </tr>
}
    </tbody>
</table>
